[Agile] Production-level Code

Without clear Definition of Done (DoD), it is hard to produce the production level code. You should clearly define the Definition of Done (DoD) before starting a project. Preparing a single definition of done that suits every situation is impossible. Each team should collaborate and come up with the definition that suits its unique environment.

1. Clear Definition of Done

  • Entry and Exit Criteria
    • Development Environment
    • Code Complete
      • Well Thought Out Naming of Variables, Functions, Methods, Classes, Parameters etc.
        • Follow the Style Guide
        • Be Consistent
        • Create Descriptive Names
      • Code Refactoring
        • Error/Exception Handling and Dispose Resources
        • Use Framework APIs and Third-Party Libraries
        • Optimizations for Code Space or Speed
        • Split Your Code into Short, Focused Units
        • Do Not Repeat Yourself
      • Code Comments
        • Do not write comments for what you are doing, instead write comments on why you are doing.
        • Specify about any hacks, workaround and temporary fixes.
        • Mention pending tasks in your to-do comments
      • Code Reviews
        • Coding Convention
        • Static Code Analysis
        • Code Complexity ... Cyclomatic Complexity
        • Code Review Tools with Checklist
        • Peer Review
      • Make Your Code Buildable and Put Everything Under Version Control
        • Code Check-in
        • Code Merging & Tagging
      • Code Coverage
        • Unit Test Cases
        • Edge Case Conditions
        • Errors/Exceptions
          • Dispose Resources
          • Check for Errors and Respond to Them
      • Avoid Security Pitfall
        • Buffer Overflows
        • Cross-site Scripting
        • SQL Injection
        • Encrypting Sensitive Data
        • Do Not Log Sensitive Data
        • No Backdoors

2. Reusibility

3. Testability

  • Design for Testability
  • Accessibility ... Stubs and Mocks for Unit and Component Testing
  • Observability ... Logging and Memory Dumps
  • Controllability ... Flexible Configuration
  • Non-functional Requirements ... Performance